package untiring.services;

import java.util.List;

import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import untiring.interfaces.MemberDAO;
import untiring.interfaces.MemberService;
import untiring.models.MemberVO;

@Service("memberService") 
// 톰캣 서버가 시작하고
// servlet-context.xml이 읽혀지고
// context:component-scan 태그가 실행된 후
// 스프링 컨테이너에게 이 클래스를 빈bean 객체로 생성해줄것을 요청
public class MemberServiceImpl implements MemberService{

	@Autowired
	// 스프링 컨테이너에게 memberDAO라는 이름의 빈 객체를 지역변수 memberDAO에 DI 해줄 것을 요청
	private MemberDAO memberDAO;

	@Override
	public String newMember(MemberVO m) {
		
		String viewPage = "join/joininfo";
		if(memberDAO.insertMember(m))
		viewPage = "redirect:/join/joinok.mvc";
		return viewPage;
	}

	@Override
	public List<MemberVO> readMember() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public MemberVO readOneMember(String mno) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String modifyMember(MemberVO m) {
		// TODO Auto-generated method stub
		return "";
	}

	@Override
	public String removeMember(String mno) {
		// TODO Auto-generated method stub
		return "";
	}
	
	@Override
	public boolean idcheck(String myuid) {
		boolean result = memberDAO.idcheck(myuid);
		return result;
	}
	
	@Override
	public MemberVO login(MemberVO m) {
	
			
		return memberDAO.login(m);
	}
	

	

}
